package com.hangjiang.gulidear.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * Configtype entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "configtype", catalog = "sqm")
public class ConfigType extends BaseEntity {

	// Fields

	private String typeId;
	private String typeName;
	private Integer pm;
	private Integer pl;
	private Integer sl;
	private Integer isDelete;
	private Set<ConfigItem> configitems = new HashSet<ConfigItem>(0);

	// Constructors

	/** default constructor */
	public ConfigType() {
	}

	/** full constructor */
	public ConfigType(String typeName, Integer pm, Integer pl, Integer sl,
			Integer isDelete) {
		this.typeName = typeName;
		this.pm = pm;
		this.pl = pl;
		this.sl = sl;
		this.isDelete = isDelete;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "typeId", unique = true, nullable = false, length = 32)
	public String getTypeId() {
		return this.typeId;
	}

	public void setTypeId(String typeId) {
		this.typeId = typeId;
	}

	@Column(name = "typeName", length = 50)
	public String getTypeName() {
		return this.typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	@Column(name = "PM")
	public Integer getPm() {
		return this.pm;
	}

	public void setPm(Integer pm) {
		this.pm = pm;
	}

	@Column(name = "PL")
	public Integer getPl() {
		return this.pl;
	}

	public void setPl(Integer pl) {
		this.pl = pl;
	}

	@Column(name = "SL")
	public Integer getSl() {
		return this.sl;
	}

	public void setSl(Integer sl) {
		this.sl = sl;
	}

	@Column(name = "isDelete")
	public Integer getIsDelete() {
		return this.isDelete;
	}

	public void setIsDelete(Integer isDelete) {
		this.isDelete = isDelete;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "configtype")
	public Set<ConfigItem> getConfigitems() {
		return this.configitems;
	}

	public void setConfigitems(Set<ConfigItem> configitems) {
		this.configitems = configitems;
	}

}